Part Number Hot Search : 
T1282 5012A BU941ZFI 200BZC C93419 1CQ2D 74HC24 SI7456
Product Description
Full Text Search
 

To Download RN171XVU-IRM Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  ? 2014-2015 microchip technology inc. ds50002230b wifly command reference manual downloaded from: http:///
ds50002230b-page 2 ? 2014-2015 microchip technology inc. information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. it is your responsibility to ensure that your application meets with your specifications. microchip makes no representations or warranties of any kind whether express or implied, written or oral, statutory or otherwise, related to the information, including but not limited to its condition, quality, performance, merchantability or fitness for purpose . microchip disclaims all liability arising from this information and its use. use of microchip devices in life support and/or safety applications is entirely at the buyers risk, and the buyer agrees to defend, indemnify and hold harmless microchip from any and all damages, claims, suits, or expenses resulting from such use. no licenses are conveyed, implicitly or otherwise, under any microchip intellectual property rights unless otherwise stated. note the following details of the code protection feature on microchip devices: microchip products meet the specification cont ained in their particular microchip data sheet. microchip believes that its family of products is one of the most secure families of its kind on the market today, when used i n the intended manner and under normal conditions. there are dishonest and possibly illegal methods used to breach the code protection feature. all of these methods, to our knowledge, require using the microchip products in a manner outside the operating specifications contained in microchips data sheets. most likely, the person doing so is engaged in theft of intellectual property. microchip is willing to work with the customer who is concerned about the integrity of their code. neither microchip nor any other semiconductor manufacturer c an guarantee the security of their code. code protection does not mean that we are guaranteeing the product as unbreakable. code protection is constantly evolving. we at microchip are co mmitted to continuously improvi ng the code protection features of our products. attempts to break microchips c ode protection feature may be a violation of the digital millennium copyright act. if such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that act. microchip received iso/ts-16949:2009 certification for its worldwide headquarters, design and wafer fabrication facilities in chandler and tempe, arizona; gresham, oregon and design centers in california and india. the company?s quality system processes and procedures are for its pic ? mcus and dspic ? dscs, k ee l oq ? code hopping devices, serial eeproms, microperipherals, nonvolatile memory an d analog products. in addition, microchip?s quality system for the design and manufacture of development systems is iso 9001:2000 certified. quality management s ystem certified b y dnv == iso/ ts 1 6 9 4 9 == trademarks the microchip name and logo, the microchip logo, dspic, flashflex, flexpwr, jukeblox, k ee l oq , k ee l oq logo, kleer, lancheck, medialb, most, most logo, mplab, optolyzer, pic, picstart, pic 32 logo, righttouch, spynic, sst, sst logo, superflash and uni/o are registered trademarks of microchip technology incorporated in the u.s.a. and other countries. the embedded control solutions company and mtouch are registered trademarks of microc hip technology incorporated in the u.s.a. analog-for-the-digital age, bodycom, chipkit, chipkit logo, codeguard, dspicdem, dspicdem.net, ecan, in-circuit serial programming, icsp, inter-chip connectivity, kleernet, kleernet logo, miwi, motorbench, mpasm, mpf, mplab certified logo, mplib, mplink, multitrak, netdetach, omniscient code generation, picdem, picdem.net, pickit, pictail, righttouch logo, real ice, sqi, serial quad i/o, total endurance, tsharc, usbcheck, varisense, viewspan, wiperlock, wireless dna, and zena are trademarks of microchip technology incorporated in the u.s.a. and other countries. sqtp is a service mark of microchip technology incorporated in the u.s.a. silicon storage technology is a registered trademark of microchip technology inc. in other countries. gestic is a registered tradem ark of microchip technology germany ii gmbh & co. kg, a subsidiary of microchip technology inc., in other countries. all other trademarks mentioned herein are property of their respective companies. ? 2014-2015, microchip technology incorporated, printed in the u.s.a., all rights reserved. isbn: 978-1-63277-737-9 downloaded from: http:///
? 2014-2015 microchip technology inc. ds50002230b-page 3 w i f ly command reference manual table of contents chapter 1. introduction 1.1 overview ........................................................................................ .............. 11 1.2 features ......................................................................................... .............. 12 1.3 supported access points ........................................... .................................. 12 chapter 2. getting started 2.1 prerequisites ........................................... ................................................... .. 13 2.2 firmware version check .................................................................. ............ 13 2.3 common tasks ................................................... ......................................... 14 chapter 3. features and settings 3.1 factory reset ............................................................................... ................ 21 3.2 associating to an access point ................................................ .................... 27 3.3 making a connection to the rn module ......................................... ............ 38 3.4 connecting the rn module to a remote device ...................... .................... 38 3.5 sending data to a remote host ................................................... .............. 40 3.6 using the html client feature ...................................................... .............. 46 3.7 ftp client features ............................................................ ......................... 51 3.8 putting the rn module to sleep and waking it .................................. .......... 53 3.9 gpio functions ............................................................................ ................ 56 3.10 setting debug print levels ......................................... ................................ 59 3.11 using the real-time clock function ........................................ .................. 61 3.12 time stamping packets ............................................................. ................ 62 3.13 soft access point (soft ap) mode ....................................... ....................... 63 3.14 upgrading firmware ............................................................... .................... 67 3.15 analog sensor capability .......................................... ................................. 74 chapter 4. command reference 4.1 command syntax ............................................... .......................................... 77 4.2 command organization ............................................... ................................ 78 4.3 set commands .......................................... ................................................... 79 4.4 get commands ................................................... ....................................... 132 4.5 status commands ................................................ ...................................... 135 4.6 action commands .......................................... ............................................ 138 4.7 file i/o commands ........................................................................ ............ 144 downloaded from: http:///
wifly command reference manual ds50002230b-page 4 ? 2014-2015 microchip technology inc. notes: downloaded from: http:///
? 2014-2015 microchip technology inc. ds50002230b-page 5 wifly command reference manual preface introduction this preface contains general information that will be useful to know before using the wifly application to access rn modules. topics discussed in this preface include: document layout conventions used in this guide recommended reading the microchip web site development systems customer change notification service customer support document revision history document layout this users guide provides information for configuring rn modules using the wifly application, including a command reference, advanced features, and applications. the document is organized as follows: chapter 1. ?introduction? C this chapter introduces the rn modules and provides a brief overview of their features. chapter 2. ?getting started? C this chapter provides information that is useful when getting started with an rn module. chapter 3. ?features and settings? C this chapter describes features and settings, including techniques to put the rn module to sleep, wake up, and meth- ods to open a tcp connection when awake. chapter 4. ?command reference? C this chapter provides information on the commands used to configure rn modules and gives examples. notice to customers all documentation becomes dated, and this manual is no exception. microchip tools and documentation are constantly evolving to meet customer needs, so some actual di alogs and/ or tool descriptions may differ from those in this document. please refer to our web site ( www.microchip.com ) to obtain the latest documentation available. documents are identified with a ?ds? number. this number is located on the bott om of each page, in front of the page number. the numbering convention for the ds number is ?dsxxxxxxxxa?, where ?xxxxxxxx? is the document number and ?a? is the revision level of the document. for the most up-to-date information on development tools, see the mplab ? x ide on-line help. select the help menu, and then topics to open a list of available on-line help files. downloaded from: http:///
wifly command reference manual ds50002230b-page 6 ? 2014-2015 microchip technology inc. conventions used in this guide this manual uses the following documentation conventions: documentation conventions description represents examples italic characters referenced books mplab ide user?s guide emphasized text ...is the only compiler... initial caps a window the output window a dialog the settings dialog a menu selection select enable programmer quotes a field name in a window or dialog save project before build underlined, italic text with right angle bracket a menu path file > save bold characters a dialog button click ok a tab click the power tab text in angle brackets < > a key on the keyboard press , plain courier new sample source code #define start filenames autoexec.bat file paths c:\mcc18\h keywords _asm, _endasm, static command-line options -opa+, -opa- bit values 0, 1 constants 0xff, a italic courier new a variable argument file .o , where file can be any valid filename square brackets [ ] optional arguments mcc18 [options] file [options] curly brackets and pipe character: { | } choice of mutually exclusive arguments; an or selection errorlevel {0|1} ellipses... replaces repeated text var_name [, var_name...] represents code supplied by user void main (void) { ... } notes a note presents information that we want to re-emphasize, either to help you avoid a common pitfall or to make you aware of operating differences between some device family members. a note can be in a box, or when used in a table or figure, it is located at the bottom of the table or figure. note 1: this is a note used in a table. note: this is a standard note box. caution this is a caution note. downloaded from: http:///
preface ? 2014-2015 microchip technology inc. ds50002230b-page 7 recommended reading this users guide describes how to use the wifly application to configure an rn module. the rn module-specific data sheets contain current information on the rn module specifications. additional microchip doc uments are available and are recommended as supplemental reference resources. to obtain any of these documents, visi t the microchip web site at www.microchip.com . rn131 module data sheet (ds70005085), rn171 module data sheet (ds70005084), and rn1723 module data sheet (ds70005224) consult these documents for detailed information on the rn131, rn171, and rn1723 modules. reference information found in this data sheet includes: device pinout and packaging details device electrical specifications list of features included on the rn module rn131/rn171/rn1723 evaluation kits user?s guide (ds50002183) this users guide describes the rn evaluation boards that are used for demonstrating the capabilities of the rn131, rn171, and rn1723 modules. these rn evaluation boards have the flexibility to connect directly to a pc or laptops through a standard usb interface or to embedded controllers through the serial uart interface. reference information in this users guide includes: overview of the evaluation kit hardware and evaluation board features and components hardware and module configuration sensor interfaces and push button functions evaluation board schematics picdem? pic18 explorer demonstration board user?s guide (ds51721) this document describes how to use the picdem pic18 explorer demonstration board as a development tool to emulate and debug firmware on a target board. refer- ence information found in this users guide includes: functionality and features hardware features development board schematics explorer 16 development board user?s guide (ds50001589) this document describes how to use the explorer 16 development board as a development tool to emulate and debug firmware on a target board. reference information found in this users guide includes: functionality and features hardware features development board schematics downloaded from: http:///
wifly command reference manual ds50002230b-page 8 ? 2014-2015 microchip technology inc. the microchip web site microchip provides online support via our web site at www.microchip.com. this web site is used as a means to make files and information easily available to customers. accessible by using your favorite internet browser, the web site contains the following information: product support C data sheets and errata, application notes and sample programs, design resources, users guides and hardware support documents, latest software releases and archived software general technical support C frequently asked questions (faqs), technical support requests, online discussion groups, microchip consultant program member listing business of microchip C product selector and ordering guides, latest microchip press releases, listing of seminars and events, listings of microchip sales of fices, distributors and factory representatives development systems custome r change notification service microchips customer notification service helps keep customers current on microchip products. subscribers will receive e-mail notification whenever there are changes, updates, revisions or errata related to a specified product family or development tool of interest. to register, access the microchip web site at www.microchip.com, click on customer change notification and follow the registration instructions. the development systems product group categories are: compilers C the latest information on microchip c compilers and other language tools emulators C the latest information on the microchip in-circuit emulator, mplab ? real ice? in-circuit emulator in-circuit debuggers C the latest information on the microchip in-circuit debugger, mplab icd 3 mplab x ide C the latest information on microchip mplab x ide, the windows ? integrated development environment for development systems tools programmers C the latest information on microchip programmers including the pickit? 3 development programmer customer support users of microchip products can receive assistance through several channels: distributor or representative local sales office field application engineer (fae) technical support customers should contact their distributor, representative or field application engineer (fae) for support. local sales offices are also available to help customers. a listing of sales offices and locations is included in the back of this document. technical support is available through the web site at: http://support.microchip.com downloaded from: http:///
preface ? 2014-2015 microchip technology inc. ds50002230b-page 9 document revision history revision a (january 2014) this is the initial released version of the document. revision b (september 2015) this revision includes the following updates: information specific to the rn1723 module was added throughout the document the content was reorganized, which includes text and formatting updates that were incorporated throughout the document downloaded from: http:///
wifly command reference manual ds50002230b-page 10 ? 2014-2015 microchip technology inc. notes: downloaded from: http:///
? 2014-2015 microchip technology inc. ds50002230b-page 11 wifly command reference manual chapter 1. introduction this reference manual provides information on the commands and features for microchip products that utilize the wifly radio module command set. the wifly radio module is a complete, stand-alone embedded wireless lan access device. the device has an on-board tcp/ip stack and applications, and in the simplest hardware configuration, requires only four pins: power, tx, rx, and ground. once the initial configuration has been performed, the device automatically accesses a wi-fi ? network and sends/receives serial data. topics covered include: overview features supported access points 1.1 overview this document is applicable to the stand-alone rn131, rn171, and rn1723 modules, as well as microchip products based on these modules. for example, the rn171xv device incorporates the rn171 module; therefore, all rn171 hardware features apply to the rn171xv. although there are some differences, the rn131, rn171, and rn1723 modules support the same ascii command set. ta b l e 1 - 1 compares the rn module features. refer to ?recommended reading? for information on accessing the rn131, rn171, and rn1723 data sheets for information on their hardware differences and for detailed hardware specifications. table 1-1: comparing the rn131, rn171, and rn1723 modules feature rn131 rn171 and rn1723 output power (p max ) 18 dbm (fixed) 12 dbm (programmable) lowest power 18 dbm 0 dbm (< 100 ma tx current) on-board antenna yes no accurate sleep timer yes (32 khz) no (+/- 10% error) gpio pins available 10, gpio4-13 (gpio1-3 are not avail- able for use) 14, gpio1-14 downloaded from: http:///
wifly command reference manual ds50002230b-page 12 ? 2014-2015 microchip technology inc. 1.2 features general: fully qualified and wi-fi certified 2.4 ghz ieee 802.11 b/g transceiver fcc, ce, ic certified, and rohs compliant ultra-low power: intelligent, built-in power management with programmable wake-up accepts 3.3v power supply or 2 to 3v battery when using boost regulators rn131: 4 a sleep, 35 ma rx, 210m tx at 18 dbm (tx power is not configurable) rn171 and rn1723: 4 a sleep, 35 ma rx, 185 ma tx at 12 dbm (tx power is configurable) antenna options: rn131: on-board ceramic chip antenna and u.fl connector for external antenna rn171 and rn1723: rf pad hardware: 8-megabit flash memory and 128 kbyte ram, 2 kbyte rom, 2 kbyte battery- backed memory general purpose digital i/o pins: - rn131: 10 gpio pins - rn171 and rn1723: 14 gpio pins eight analog inputs (14 bits, 1.2v) real-time clock for wake-up and time stamping/data logging; automatic sleep and automatic wake-up modes network support: supports soft ap mode and infrastructure networking modes push button wps mode for easy network configuration on-board tcp/ip stack over the air firmware upgrade (ftp) secure wi-fi authentication via wep, wpa-psk (tkip), and wpa2-psk (aes) configuration over uart or wireless interfaces using simple ascii commands built-in networking applications: dhcp client, dns client, arp, icmp ping, ftp client, telnet, http, udp, and tcp 1.3 supported access points the rn module should work with any standard access point (ap). microchip has tested the rn modules with access points from the following manufacturers: airlink101 ? apple ? asus belkin buffalo networks inc. cisco d-link ? dynex ? linksys netgear smc ? networks tp-link downloaded from: http:///
? 2014-2015 microchip technology inc. ds50002230b-page 13 wifly command reference manual chapter 2. getting started this chapter provides information for the purpose of getting started with using an rn module. all of the commands discussed in this chapter are described in detail in chapter 4. ?command reference? . topics in this chapter include: prerequisites firmware version check common tasks 2.1 prerequisites prior to using an rn module for the first time, readers should be familiar with the information in the ?rn131/rn171/rn1723 evaluation kits user?s guide? (ds50002183), which is available from the microchip website ( www.microchip.com ). refer to ?recommended reading? for information on additional resources. 2.2 firmware version check the set of available commands and features for a particular rn module depend greatly on the installed file system contents. each rn module is loaded with firmware prior to leaving the factory. consult the microchip website for firmware information by visiting: http://www.microchip.com/wifi . the rn module has a file system for storing firmware, as well as configuration files. to view the firmware version, use the ls command. the file size is displayed in sectors and the active boot image is identified in the final message. the wifly firmware version returned by the ls command is shown in bold type in example 2-1 . example 2-1: determining the firmware version fl# siz flags 2 88328 3 wifly-fzx-100-r1634i 5 74432 3 web_app-fzx-112 8 46836 3 wps_app-fzx-131 10 66677 3 eap_app-fzx-105 12 51053 0 web_config.html 25 512 0 link.html 26 7268 0 logo.png 28 1060 10 config downloaded from: http:///
wifly command reference manual ds50002230b-page 14 ? 2014-2015 microchip technology inc. 2.3 common tasks this section provides information on the common tasks users may perform when using an rn module, which includes the following topics: configuring the rn module performing a factory reset provisioning onto and associating with a wi-fi network sending data creating a soft access point module sleep and wake-up 2.3.1 configuring the rn module the rn module has two modes of operation: data mode and command mode. in data mode, the rn module can accept incoming connections or initiate outgoing connections. to configure parameters and/or view the current configuration, the rn module must be placed into command mode. 2.3.1.1 entering command mode by default, the rn module is in data mode after power-up. sending the escape sequence of three dollar signs, $$$ , causes the rn module to enter command mode. the three dollar sign ( $ ) characters must be sent in succession with no additional characters before or after. a carriage return () or line feed must not be sent after entering $$$ to enter command mode. after entering the sequence, the rn module replies with cmd to indicate it is in command mode. once in command mode, the rn module can be configured using simple ascii commands, with each command ending with a carriage return . most valid commands return aok , with the exception of the rn1723, which returns ok ; invalid commands return a err description. to exit command mode, send an exit command by typing exit following by a . the rn module responds with exit , indicating that it has exited command mode and has entered data mode. 2.3.1.2 parameters various parameters can be viewed, such as the ssid, channel, ip address, serial port, and other settings, which can be configured in command mode. 2.3.1.3 sending commands commands must be sent to the rn module through the uart or remotely via telnet (telnet can only be used with the rn131 and rn171). when using the uart interface, the communications settings should match the rn modules stored settings. the default settings are 9,600 baud, 8 bits, no parity, 1 stop bit, and hardware flow control disabled. command mode can be entered locally over the uart interface at any time regardless of an active tcp connection. note: there is a 250 ms time buffer before and after the $$$ escape sequence. if characters are sent before or after the escape sequence within this 250 ms interval, the rn module treats them as data and passes them over the tcp or udp socket, and the rn module will not enter command mode. note: depending on the operating system, microchip suggests using one of the following terminal emulator applications: tera term (windows) or coolterm (mac). downloaded from: http:///
getting started ? 2014-2015 microchip technology inc. ds50002230b-page 15 2.3.1.4 automatic access point association when the rn module powers up, it attempts to automatically associate with the access point stored in its configuration settings if the auto-join feature is enabled. in firmware version 4.0 and later, the auto-join feature is disabled by default. enable it using the ascii command set wlan join 1 . the auto-associate feature can be disabled (default behavior) using the set wlan join 0 command. this command prevents the rn module from attempting to associate with a network that does not exist. 2.3.2 performing a factory reset the factory reset command initializes all of the wifly module parameters to their factory default values. the default parameters only take effect after the rn module has been rebooted. refer to 3.1.1 ?default parameters after factory reset? for more information. to perform a factory reset, first issue the factory reset command and then reboot the rn module, as follows: factory reset // restores default parameter values reboot // restart module; default parameters take effect 2.3.3 provisioning onto and associating with a wi-fi network before being allowed to communicate on a wi-fi network, an rn module must first be provisioned, associated to an access point in the network, and have a valid ip address. there a three common ways to provision and associate an rn module onto a wi-fi network: association using command mode (via a usb-uart connection) this is the most commonly used method, which is described in the next section. association through wps association through a web interface note: for information on associating using wps or a web interface, consult the ?rn131/rn171/rn1723 evaluation kits user?s guide? (ds50002183), which is available from the microchip website ( www.microchip.com ). downloaded from: http:///
wifly command reference manual ds50002230b-page 16 ? 2014-2015 microchip technology inc. 2.3.3.1 association using command mode to associate using command mode, perform the following steps: 1. connect the rn evaluation board to the host (computer) using the usb connection. the green led should begin blinking. 2. open the terminal emulator application on the host. 3. configure the serial port: a) locate the com port that is assigned to the usb cable connected to the rn evaluation kit. b) in the terminal emulator, select the com port and open the serial port setup dialog and make the following selections: baud rate: 9600 data bits: 8 parity: none stop bits: 1 flow control: none 4. enter command mode by sequentially typing $$$ with no other characters before or after (by default, the rn module is in data mode). 5. in the terminal emulator, type scan and press to actively scan for available networks. 6. to associate with the desired ap or network, enter the following commands in the terminal emulator. set wlan ssid // sets the rn module to automatically // associate with the specified network // upon boot-up. set wlan pass // provides the password to connect to // the specified network set wlan join 1 // sets the policy for automatically // associating with access points. in // this case, the 1 refers to // associating with an ap that matches // the stored ssid save // save the settings to a file named // config (default) reboot // force a reboot downloaded from: http:///
getting started ? 2014-2015 microchip technology inc. ds50002230b-page 17 2.3.4 sending data after the rn module has associated with a network and a valid ip address has been obtained, data can be sent between two rn modules or from an rn module to a server. two methods to transfer data are available: tcp and udp. tcp is the most common method, which is described in this section. refer to the ?rn131/rn171/rn1723 evaluation kits user?s guide? (ds50002183) for information on transferring data through udp. perform the following steps to transfer data using tcp: 1. configure two rn modules to associate with an ap, as described in 2.3.3 ?provisioning onto and associating with a wi-fi network? . 2. obtain the ip address assigned to each rn module using the get ip command, as shown in the below example. in this example, the ip addresses assigned are 192.168.1.108 and 192.168.1.109. 3. on one of the rn modules, open a socket using the following commands: set ip proto 0x2 // sets the ip protocol. the parameter // 0x2 is a bit-mapped register, which // sets the protocol to tcp. set ip host 192.168.1.109 // sets the ip address of the remote host set ip remote 2000 // sets the port number of the remote host open // opens a tcp connection the terminal emulators on the local host and remote host respond with *open**hello* to indicate the connection was opened successfully. typing into one terminal emulator will display the result on the other terminal emulator. 4. use the close command to close the socket and disconnect tcp. remote host local host downloaded from: http:///
wifly command reference manual ds50002230b-page 18 ? 2014-2015 microchip technology inc. 2.3.5 creating a soft access point in soft access point (soft ap) mode, the rn module provides the following capabilities: creates a soft ap network to which client devices, such as smartphones and tablets can join runs a dhcp server and issues ip addresses to a maximum of seven clients supports security supports routing between clients (only when security is not enabled) there are two methods, hardware and software, to enable soft ap mode on an rn module. enabling soft ap mode in hardware is done by holding the gpio9 pin high (at 3.3v), and then resetting the rn module by cycling the power. the rn module will boot-up in soft ap mode. to enable soft ap mode in software, the apmode command is used. once an rn module is in soft ap mode, any client device can associate with the net- work the rn module is broadcasting. 2.3.5.1 customized soft ap mode network settings the following commands illustrate customized network settings that can be used after enabling soft ap mode: set wlan join 7 // creates a soft ap network using // stored configuration values. the ap // is created upon power-up, reboot, or // waking from sleep. set apmode ssid // set the network broadcast ssid set apmode passphrase // set the ap mode passphrase set ip address
// specify the ip address save // save the settings reboot // reboot the rn module in soft ap mode refer to 3.13 ?soft access point (soft ap) mode? for detailed information on both methods. downloaded from: http:///
getting started ? 2014-2015 microchip technology inc. ds50002230b-page 19 2.3.6 module sleep and wake-up there are three methods by which an rn module can be placed into sleep mode. the first method is by using the sleep command through the uart interface the second method is to use the sleep timer through the internal rtc interface. in this method, the rn module sleeps for the number of seconds specified in the set sys wake command. the third method is to drive the gpio8 pin high. in this method, the rn module sleeps as soon as the gpio8 pin is set high. to enable this feature, use the set sys trigger 0x20 command. 2.3.6.1 using timers for sleep and wake-up wifly-based rn modules have a set of timers that can be used to both put the rn module to sleep and to wake-up the rn module. while the rn module is sleeping, it consumes only 4 a of current. during the time the rn module is awake, it can be made to perform any operation the application requires. the following set of commands illustrate one method of periodically putting the rn module to sleep for a period of time, and then waking up the rn module: set wlan ssid my_net // sets the ssid to connect to after // waking up set wlan passphrase my_pass // set the connection passphrase set sys sleep 30 // set the rn module to sleep after being // awake for 30 seconds set sys wake 90 // wakes the rn module after being in // sleep for 90 seconds save // save the settings reboot // reboot the rn module refer to 3.8 ?putting the rn module to sleep and waking it? for more information. downloaded from: http:///
wifly command reference manual ds50002230b-page 20 ? 2014-2015 microchip technology inc. notes: downloaded from: http:///
? 2014-2015 microchip technology inc. ds50002230b-page 21 wifly command reference manual chapter 3. features and settings this chapter describes the rn modules features and settings, including techniques for placing the rn module into sleep mode and waking up the rn module, as well as methods to open a tcp connection when the rn module is awake. in addition, the uart flow control, alternative gpio functions, and the real-time clock are described. the following topics are discussed: factory reset associating to an access point making a connection to the rn module connecting the rn module to a remote device sending data to a remote host using the html client feature ftp client features putting the rn module to sleep and waking it gpio functions setting debug print levels using the real-time clock function time stamping packets soft access point (soft ap) mode upgrading firmware analog sensor capability 3.1 factory reset performing a factory reset on an rn module initializes all of the rn module parameters to their factory default state. this is accomplished by first issuing the factory reset command, immediately followed by the reboot command. internal to the rn module, the factory reset command loads all of the default param- eter settings into ram, and then writes these settings into a standard configuration file that the rn module maintains. when the rn module is subsequently rebooted, the settings that were saved in the configuration file take effect. microchip recommends that before any major operational modes changes are made to an rn module, that a factory reset and a reboot command be executed. one such example is switching the rn module from operating as a soft ap to that of a hmtl client. in this instance, the procedure would be to first factory reset and reboot the rn module, set it up as a html client, save the configuration, and then reboot the rn module a second time. 3.1.1 ?default parameters after factory reset? lists all of the default wifly settings for an rn module. downloaded from: http:///
wifly command reference manual ds50002230b-page 22 ? 2014-2015 microchip technology inc. 3.1.1 default parameters after factory reset table 3-1: soft ap mode parameters table 3-2: broadcast parameters table 3-3: comm parameters table 3-4: dns parameters table 3-5: ftp parameters parameter default value comment beacon 102 time in milliseconds. for soft ap mode only . probe 5 number of seconds for beacons before declar- ing soft ap is lost. for soft ap mode only . reboot 0 for soft ap mode only . parameter default value comment ip address 255.255.255.255 port 55555 interval 7 time in seconds. backup address 0.0.0.0 backup port 0 parameter default value comment close string *open* open string *clos* remote string *hello* flush size 1420 match character 0 flush timer 10 time in milliseconds. idle timer 0 cmd char $ parameter default value comment ip address 0.0.0.0 name dns1 backup rn.microchip.com lease 8640 for soft ap mode only . parameter default value comment server address 0.0.0.0 file wifly-gsx-.img firmware for rn131 modules. wifly-ezx.img firmware for rn171 modules. wifly-fzx.img firmware for rn1723 modules. wifly3-.mif firmware and applications for rn131 modules. wifly7-.mif firmware and applications for rn171/rn1723 modules. user roving password pass123 dir public timeout 200 ftp_mode 0x0 downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 23 table 3-6: ip parameters table 3-7: optional parameters table 3-8: system parameters table 3-9: time server parameters parameter default value comment dhcp on 1 equals enabled. ip address 0.0.0.0 net mask 255.255.255.0 local port 2000 gateway 0.0.0.0 host 0.0.0.0 remote port 2000 protocol 2 tcp server and client. mtu 1524 flags 0x7 tcp mode 0x7 backup 0.0.0.0 parameter default value comment device id wifly-gsx join timer/wpa timer 1000 replacement char $ 0x24 format 0x00 password no password enforced. signal 0 average 5 parameter default value comment sleep timer 0 wake timer 0 trigger 0x1 sens0 pin wakes up the device. auto connect 0 iofunc 0x0 no alternate functions. iomask 0x20f0 for rn131 modules. 0x21f0 for rn171 and rn1723 modules. iovalue 0x0 print level 0x1 print enabled debug register 0x0 unused parameter for future development. leave at default value. launchstring web_app parameter default value comment enable 0 disabled. server address 64.90.182.55 fixed to port 123 - sntp protocol. zone 7 pacific time zone (usa). downloaded from: http:///
wifly command reference manual ds50002230b-page 24 ? 2014-2015 microchip technology inc. table 3-10: uart parameters table 3-11: wlan parameters 3.1.2 string variable sizes ta b l e 3 - 1 2 provides the string variable sizes for the following parameters: parameter default value comment baudrate 9600 flow 0 disabled. mode 0 cmd_gpio 0 parameter default value comment ssid roving1 channel 0 automatic scan. external antenna 0 off - use on-board chip antenna. for rn131 modules only . join mode 1 automatically scan and join based on ssid. 0 automatic scan and join is disabled. authentication mode open mask 0x1fff all channels. rate 12 24 megabit. linkmon 0 passphrase rubygirl tx power 0 implies 12 dbm. for rn171 modules only . table 3-12: string variable sizes parameter type parameter value (bytes) ftp file 32 user 16 pass 16 dir 32 wlan ssid 32 phrase 64 dns dns host name 64 dna back-up host name 64 comm open 32 close 32 remote 64 deviceid 32 downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 25 3.1.3 restoring default configuration settings 3.1.3.1 restoring throug h software and hardware the default factory configuration settings can be restored in software and hardware. software C in command mode, use the factory reset command to restore the default settings. this command automatically loads the default settings and exe- cutes a save command. next, send the reboot command so that the rn module reboots with the default configuration. hardware C set the gpio9 pin high on power-up to enable the factory reset func- tion. then, toggle gpio9 five times, which restores the configuration to the factory reset. the gpio9 pin is sampled at approximately 1 hz; therefore, if a cpu is used to generate the signal, ensure that gpio9 transitions (high-to-low or low-to-high) for a period of at least one second. 3.1.3.2 user configuration file a user configuration file can be specified and then used to restore a custom set of fac- tory reset settings. for example, if the configuration file named user is found on the rn modules file system, the rn module reads it as the factory default in stead of using the factory hardcoded defaults. if no user configuration file is present, the rn module uses the hardcoded factory defaults. the user configuration file is created using the save user command, which saves the current configuration settings into a file named user . even if a user configuration file exists, enabling and toggling the gpio9 pin seven times overrides the user settings and restores the rn module to the factory hardcoded defaults. this bypass mechanism allows the factory defaults to be restored in the event that an invalid parameter was saved in the user-defined configuration file. issuing the factory reset command while in command mode restores the rn module to a factory default state. 3.1.4 boot-up timing values ta b l e 3 - 1 3 shows the boot-up timing values. note: the user configuration file can be specified based on firmware version, as follows: rn131 and rn171 modules with firmware version 2.45 and later rn1723 modules with firmware version 1.0 or later note: the rn module must be rebooted or reset for the new settings to take effect. table 3-13: boot-up timing values function description time (ms) power-up power-up time from reset high or from the time of power-u p to when boot code is loaded from flash to ram. 70 initialization initialize ecos. 50 ready load configuration and initialize application. 30 downloaded from: http:///
wifly command reference manual ds50002230b-page 26 ? 2014-2015 microchip technology inc. join associate using channel = 0 (full channel scan, mask = 0x1fff). 80 associate using channel = 0 (primary channel scan, mask = 0x421) 15 associate using channel = x (fixed channel) 5-20 authentication authenticate using wpa1 or wpa2 (highly dependent on access point response) 50-250 acquire ip dhcp obtain ip address (highly dependent on dhcp server response time) soft ap dependent table 3-13: boot-up timing values function description time (ms) downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 27 3.2 associating to an access point configuring the rn module to make connections involves associating with an access point and opening a connection. before the rn module can be configured over the wi-fi link, the rn module must be associated with a network and the network settings must be programmed. therefore, the best method is to configure the rn module is by using the uart. this section describes how to configure the rn module over the uart using the rs-232 connector or an evaluation board. for this mode, open a ter- minal emulator on the com port associated with the rn module. the default baud rate is 9,600, 8 bits, and no parity. 3.2.1 associate with an access point from within the terminal window, place the rn module into command mode by typing $$$ . the rn module responds with cmd , indicating that it is in command mode. type show net to display the current network settings, as shown in figure 3-1 . figure 3-1: display current network settings find all available networks with the scan command, as shown in figure 3-2 . figure 3-2: find available networks to connect to an open network, use the join command to associate with the access point. the scan list in figure 3-2 shows that roving1 is an open access point. type join roving1 (or join # 1 ) to associate with the network, as shown in figure 3-3 . cmdshow net ssid=theloft chan=6 assoc=ok dhcp=ok time=fail links=1 <2.03> cmd scan <2.03> scan:found 6 num ssid ch rssi sec mac address suites 1 roving1 01 -64 open 00:1c:df:4f:45:9e 104 4 2 netgear 01 -58 open 00:22:3f:6b:95:42 104 0 3 07fx12018434 06 -73 wep 00:18:3a:7e:71:d7 1104 0 4 theloft 06 -51 wpa2psk 00:0c:41:82:54:19 aesm-aes 1100 0 5 airlink-11 11 -53 wpav1 00:18:02:70:7e:e8 tkipm-tkip 3100 ac 6 sensor 11 -52 open 00:1c:df:cc:aa:d8 100 1 downloaded from: http:///
wifly command reference manual ds50002230b-page 28 ? 2014-2015 microchip technology inc. figure 3-3: join the network if the access point is secure, the passphrase must be set prior to issuing the join command. the rn module attempts to inquire and determine the access points security protocol which means the authentication mode does not need to be set. to set the wpa passphrase use the set wlan passphrase command. for wep, set the key using the set wlan key command. once the rn module has joined the network successfully, it stores the access points ssid. the ssid and the passphrase can be saved to the configuration file so that the rn module can associate with the access point each time it boots. 3.2.2 wi-fi protected setup (wps) wi-fi protected setup (wps) protocol created by the wi-fi alliance is a standard for easy and secure establishment of a wireless home network. the goal of the wps protocol is to simplify the process of configuring security on wireless networks. the protocol is meant to allow home users who know little of wireless security and may be intimidated by the available security options to configure wi-fi protected access, which is supported by most wi-fi certified devices that are available for purchase today. the most common mode of wps is the push button (pbc) mode, in which the user simply pushes a button on both the access point and the wireless client (e.g., the rn module), as shown in figure 3-4 . figure 3-4: push button wps <2.03> join roving1 auto-assoc roving1 chan=1 mode=open scan ok <2.03> associated! dhcp in 1ms: renew: 86400 s if is up dhcp=on ip=10.20.20.62:2000 nm=255.255.255.0 gw=10.20.20.20 host=0.0.0.0:2000 proto=2 mtu=1460 bind=-10 listen fail downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 29 depending on the firmware version, the rn module supports the wps feature. figure 3-5: confir ming wps application installation note: use the ls command to confirm whether the rn module supports the application, as shown in figure 3-5 . downloaded from: http:///
wifly command reference manual ds50002230b-page 30 ? 2014-2015 microchip technology inc. 3.2.2.1 launching a wps application there are two ways to run a wps function: using the run wps command in the console using gpio9 to run a wps function using the factory reset (gpio9) mode: 1. enable the wps function on gpio9 using the set sys launch wps_app command. wps on gpio9 is disabled by default to avoid accidentally running the wps function. 2. the wps application is started when gpio9 asserted. when the wps application launches, it negotiates the ssid and passphrase with the soft ap and reboots the rn module to associate with the wps-enabled access point. by default, during the wps process, the rn module prints messages on the uart as it scans channels, detects access points, and tries to complete wps. these messages are disabled using the set sys print 0 command. note: depending on the firmware version, if the gpio9 pin is high, the rn module boots in soft ap mode. care must be taken to drive gpio9 low before the rn module reboots. a good indicator is the red led on the rn171 evaluation board. when this led flashes, indicating the rn module is scanning for a wps-enabled access point, the gpio9 pin should be driven low. downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 31 3.2.3 configuration web server this section describes how to use the rn modules configuration web server to associate an rn module to an access point. rn modules can operate in one of two modes: infrastructure and soft ap. infrastructure mode in this mode, the rn module can join a network created by an access point. soft ap mode in this mode, the rn module behaves as an access point with limited functionality. a key challenge when using any embedded device in infrastructure mode is to provision it so that it can associate with a soft ap. this process requires storing the sof t aps settings, such as the ssid and passphrase, in the embedded device. embedded wi-fi modules can be configured or provisioned to join an infrastructure network in several ways: sending ascii commands to the rn module over a uart sending ascii commands remotely while the rn module is in soft ap mode using wi-fi protected setup (wps) sending commands to the rn module remotely using a web interface 3.2.3.1 using the configuration web server configuring the embedded rn module to associate with an soft ap in infrastructure mode involves the following process: 1. start the rn modules configuration web server. 2. connect the client device (i.e., pc, smartphone, tablet, etc.) to the rn modules soft ap network. 3. access the rn modules configuration web page from the client devices web browser. 4. save the settings (ssid and passphrase) in the web browser and exit. note: depending on the firmware version, the web server application is available for use in configuring the rn module, as follows: rn131 and rn171 modules with firmware version 4.0 and later rn1723 modules with firmware version 1.0 or later downloaded from: http:///
wifly command reference manual ds50002230b-page 32 ? 2014-2015 microchip technology inc. 3.2.3.1.1 start the configuration web server the web server can be enabled in one of two ways: hardware or software. when the configuration web server is started, it creates a soft ap network with the settings shown in ta b l e 3 - 1 4 . 3.2.3.1.2 starting the configuration web server in hardware the web server can be started through hardware using gpio9. to use gpio9, specify that the web application should launch using the command set sys launch_string web_app (default configuration). with the launch string set, drive the gpio9 pin high any time after power-up to start the web server. the rn module creates a soft ap network with the parameters previously described in table 3-14 . 3.2.3.1.3 starting the configuration web server in software if gpio9 is not accessible using a push button or a jumper, an embedded microcontroller can start the configuration web server mode in software using the command run web_app . this command runs the configuration web server application and creates a soft ap network to which devices can join and configure the rn module from a web browser. table 3-14: soft ap network settings setting soft ap mode default ssid wifly-gsx-xx (rn131 module) wifly-exz-xx (rn171) wifly-fxz-xx (rn1723) where xx ? is the last byte of the rn modules mac address. channel 1 dhcp server enabled ip address 192.168.1.1 netmask 255.255.255.0 gateway 192.168.1.1 note: the soft ap networks ssid uses the rn modules device id parameter. if the device id parameter is changed using the set opt device_id command, the rn module uses this new device id as the soft ap networks ssid. the device id parameter is not set to a default if a factory reset is performed. note 1: do not drive gpio9 high upon power-up. doing so starts soft ap mode and does not launch the web server. 2: when using an evaluation kit, gpio9 is accessible using a jumper or push button. downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 33 3.2.3.2 status leds in configuration web server mode the status leds provide a visual indication of the rn modules state while using the configuration web server feature, as shown in ta b l e 3 - 1 5 . 3.2.3.3 using the web server to configure the rn module this section describes how to use the web server to configure the rn module with the ssid and passphrase of the soft ap. the example uses the internet explorer web browser running on a windows 7 personal computer; however, the same concepts apply to any device with a wi-fi interface, such as an iphone, android smartphone, tablet, or pcs, running a web browser such as chrome, firefox, or safari. to configure the rn module using a web browser, perform the following steps: 1. associate a pc to the rn modules soft ap network, as shown in figure 3-6 . figure 3-6: modul e?s network name 2. launch a web browser. table 3-15: status leds event led action launch soft ap mode red, green blink alternately yellow, blue off client associated with the soft ap network green solid on yellow blinks fast (twice per second) web browser launched on the client blue solid on green solid on yellow blinks fast (twice per second) downloaded from: http:///
wifly command reference manual ds50002230b-page 34 ? 2014-2015 microchip technology inc. 3. type http://config to go to the home page of the web server running on the rn module. the page has two tabs displayed by default, as shown in figure 3-7 : network configuration this tab is used to set the soft aps ssid and passphrase. information this tab displays the following information about the rn module: - rn modules mac address - module type (rn131 or rn171/rn1723) - list of files on the file system - battery strength figure 3-7: network configuration tab downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 35 4. select the network configuration tab, as shown in figure 3-7 . the rn modules network settings (ssid and passphrase) are configured using this tab. configure these settings as follows: a) enter the networks ssid in the access point ssid field. alternatively, click refresh list . the rn module scans for networks and dis- plays a list of found networks. select your network from the available access points list or enter it in the access point ssid box. clicking an ssid displays a drop-down menu with more information about that network, such as channel, rssi, security mode (wep, wpa, wpa2), capabilities, wap configurations, wps configuration, and the soft aps mac address (also called bssid). if the desired access point is not in the list, click refresh list to scan again. b) enter the soft aps security passphrase in the passphrase field. c) (optional) the rn module uses dhcp by default. to assign the rn module a static ip, turn off the check to enable dhcp option and enter the static ip, subnet mask, and gateway. d) once the network settings have been configured, click save configuration to save the settings to the rn module. 5. exit the web server by clicking exit web configuration app . the rn module reboots in infrastructure mode and joins the wireless network. note: if the wireless network is hidden (i.e., not broadcasting an ssid), it does not display in the scan output. in this case, the ssid must be manually entered. downloaded from: http:///
wifly command reference manual ds50002230b-page 36 ? 2014-2015 microchip technology inc. 3.2.3.4 using the advanced tabs turning on the display advanced tabs option (bottom right corner of the application window) opens the terminal and module configuration tabs. 3.2.3.4.1 terminal tab click the terminal tab (see figure 3-8 ). in this tab, ascii commands can be issued to configure any of the rn modules parameters. the web server includes a help utility that guides the user through the rn module configuration. to use this feature, type help in the terminal. figure 3-8: terminal tab downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 37 3.2.3.4.2 module configuration tab click the rn module configuration tab (see figure 3-9 ). in this tab, the rn modules frequently used parameters such as device id, uart baud rate, and flow control are configured. other parameters can be configured using ascii commands in the terminal tab. figure 3-9: module configuration tab 3.2.3.5 web server timers the application includes two timers to ensure that the web server runs smoothly: idle timer browser disconnect timer 3.2.3.5.1 idle timer the idle timer ensures that the client associated with the rn modules soft ap network is not lost or unresponsive. if there is no interaction between the configuration web server and the clients web browser for five minutes (default value), the rn module reboots to the boot image. to restart the configuration web server, it must be started in software or hardware as described in 3.2.3.1.1 ?start the configuration web server? . the time-out defaults to five minutes (300 seconds) and is configurable via the following command: set comm idle < seconds > 3.2.3.5.2 browser disconnect timer this timer is used to recover from an unexpected situation in which the configuration web server on the rn module becomes unresponsive to the requests sent out by the web browser. the web browser periodically sends requests to the configuration web server. if the rn module does not receive a request within 60 seconds, it assumes that the configu- ration web server has become unresponsive and it reboots itself into configuration web server mode. then, the device must be reassociated with the rn modules soft ap network and the web page must be refreshed. downloaded from: http:///
wifly command reference manual ds50002230b-page 38 ? 2014-2015 microchip technology inc. 3.3 making a connection to the rn module to connect to the rn module from a remote device, open an ip socket and connect to the rn modules ip address. telnet can be used to test the connection by typing open
in a telnet window. after the connection is open, characters can be typed in the uart window and viewed in the telnet window or vise versa. example 3-1: open a connection to make a connection from the rn module the server applications ip address and port number must be known. a com port redirector is a simple program that can be used to test this functionality. this software opens an ip port and transfers all data it receives to a specified com port on a users personal computer. a free com port redirector program for windows is available from pira at: http://www.pira.cz/eng/piracom.htm . in the com port redirector program, note the ip address of the personal computer by typing the ipconfig command in the microsoft command window. from the terminal emulator, place the rn module into command mode, and then type the open
command. the server reports that the connection is open and characters can be typed into the uart window and viewed on the server window or vice versa. 3.4 connecting the rn module to a remote device some applications require the rn module to connect to a remote server, send data, and then disconnect automatically upon power-up (or wake-up). the rn module can be configured to perform this functionality automatically. set the network ssid and security, and set auto-join to 1. when the rn module wakes up or is powered on, the auto-connect timer causes the rn module to attempt a con- nection to the stored remote ip address and port. the sleep timer does not decrement while this connection is open, and the idle timer does not decrement while data is flow- ing. when data stops for five seconds, the connection is closed, and the sleep timer places the rn module in deep sleep mode. the wake timer begins the cycle again one minute later. example 3-2: autom atic connection open 10.20.20.62 2000 // open the host (see figure 3-3 ) set ip host
// set up the ip address of the // remote machines ip address set ip remote_port // set up the ip port of the // remote machine set sys autoconn 1 // automatically connect when ready set com idle 5 // disconnect after 5 seconds with no // data activity set sys sleep 2 // sleep 2 seconds after the // connection is closed set sys wake 60 // wake up after 1 minute of sleep set uart mode 2 // use uart data trigger mode, which // causes the rn module to make a // tcp/http connection upon incoming // uart data downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 39 3.4.1 controlling connections using gpio5 and gpio6 the gpio5 pin can be used to control the tcp connection. after configuring the pin with the set sys iofunc command, the rn module attempts to connect to the stored ip address and port when gpio5 goes high and disconnects when gpio5 goes low. similarly, the connection status can be monitored by reading the gpio6 pin. when it goes high, the connection is open, and when it goes low, the connection is closed. use the command set sys iofunc command to enable gpio6. example 3-3: use gpio5 and gp io6 to contro l connections 3.4.2 using dns settings the rn module contains a built-in dns client. if the ip address of the host is not specified (i.e., it is set to 0.0.0.0), the rn module uses the dns protocol. when the host name is set using the set dns name command, the rn module automatically attempts to resolve the host address. when the address is resolved, the rn module automatically connects. use the lookup command to manually look up a hosts ip address, where is the host name. example 3-4: use dns 3.4.3 using the back-up ip address/connect function the rn module contains a feature for auto-retry and redundancy. if the hosts first ip address connection fails, the rn module uses the back-up ip (if set). if this fails (or is not set), the rn module uses the first dns name. if this fails (or is not set), the rn module uses the back-up dns name (if set). example 3-5: set the back-up ip address example 3-6: set the back-up dns name set sys iofunc 0x20 // enable gpio5 set sys iofunc 0x40 // enable gpio6 set dns name my_server // set the dns host name to my_server set ip backup
// set the back-up ip address set dns backup // set the back-up host name downloaded from: http:///
wifly command reference manual ds50002230b-page 40 ? 2014-2015 microchip technology inc. 3.5 sending data to a remote host 3.5.1 controlling connections with gpio pins in embedded applications it is useful to monitor and control the status of the tcp/ip connection. to monitor and control the rn modules connection status, enable the alternate function of gpio4-gpio6. using the alternate function for these gpio pins, the rn module connects to the stored remote host ip address and port when gpio5 is driven high, and disconnects when driven low. the tcp/ip connection status can be monitored by reading gpio6; it is high when connected, and low when not connected. to configure the rn module to connect using gpio5 and gpio6, use the following commands: set ip host
// set the ip address of the remote host set ip remote // set the ip port of the remote host set sys iofunc 0x70 // set alternate function for gpio4-gpio6 save // store configuration reboot // reboot the rn module after executing these commands, run the application or other software on the remote host that opens and listens on the specified port. then, connect gpio5 to the embed- ded processor or other control signal. when gpio5 is driven high, the rn module attempts to connect. when gpio5 is driven low, the connection is closed. if the connection to the remote host is successful, gpio6 goes high. if the comm open and remote strings are set, the uart displays *open* and the remote host displays *hello* . figure 3-10 shows the process of controlling connections with the gpio pins. figure 3-10: controlling conne ctions with the gpio pins warning do not drive the gpio pin with more than 3.3v dc or permanent damage to the rn module will occur. (pehgghg 0lfursurfhvvru 51 0rgxoh *3,2slq +ljke\510rgxoh *3,2slq +ljke\0lfursurfhvvru *3,2slq +ljke\510rgxoh (yhqw 7kh51prgxohlvdvvrfldwhgzlwkdqdffhvv srlqwdqgkdvdydolg,3dgguhvv 7kh51prgxohlvlqvwuxfwhgwrrshqd7&3,3frqqhfwlrqwrwkhvwruhguhprwhkrvw (yhqw 7kh51prgxohvxffhvvixoo\rshqvwkh7&3 frqqhfwlrqwrwkhvwruhguhprwh+rvw 7klvvljqdolqvwuxfwvwkhplfursurfhvvruwkdwlwlv2.wrrshqd7&3frqqhfwlrq (yhqw wkhplfursurfhvvruzdqwvwrrshqd7&3 frqqhfwlrqwrwkhvwruhguhprwh+rvw7klvvljqdolqvwuxfwvwkhplfursurfhvvruwkdwwkh7&3 frqqhfwlrqlvrshqdqglwfdqehjlqvhqglqjuhfhlylqj gdwdryhuwkh7&3olqn7rforvhwkhfrqhqfwlrqwkh plfursurfhvvrugulyhvwkh*3,2slqorz downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 41 3.5.2 system and auto-connect timers the rn module uses a real-time clock (rtc) to generate timers. the rtc is active even when the rn module is asleep, allowing the rn module to be put to sleep and woken based on timer intervals. the rn module has the following timers: sleep timer this timer is used to put the rn module to sleep. it is a 32-bit number, which corresponds to a maximum 1.19 million waking hours. the sleep timer is set with the set sys sleep command, where is a decimal number representing seconds. wake timer this timer is used to wake the rn module. it is a 22-bit number, which corresponds to a maximum sleep time of 1,165 hours. the wake timer is set with the set sys wake command, where is a decimal number representing seconds. auto-connect timer this timer is used to automatically open a tcp connection. idle timer this timer is used to automatically close a tcp connection. the sleep and wake timers are responsible for putting the rn module to sleep and waking up the rn module. if the sleep timer is enabled, the rn module automatically goes into deep sleep low-power mode once the timer counts down to zero. the sleep timer is disabled if the rn module has an ip connection or is in command mode. for example, to wake the rn module, join a network, and have the rn module available to accept tcp connections for 30 seconds every two minutes, the timers would be set, as shown in example 3-7 . example 3-7: figure 3-11 shows the transitions between the sleep and awake state based on the sleep and wake timer settings in the previous example. figure 3-11: sleep and awake state transitions set wlan ssid my_net // set the host name set wlan passphrase my_pass // set the passphrase set sys sleep 30 // module sleeps after being awake // for 30 seconds set sys wake 90 // module wakes after sleeping for // 90 seconds save // save the settings reboot // reboot the rn module aake state sleep state sleep timer 30 s wake timer 90 s sleep timer 30 s downloaded from: http:///
wifly command reference manual ds50002230b-page 42 ? 2014-2015 microchip technology inc. 3.5.3 using tcp to send data after the rn module wakes, a tcp connection to a remote host can be opened in a number of ways, as described in ta b l e 3 - 1 6 . the remote host is set using the following commands: set ip host
// sets the ip address of the host or set dns name // sets the url of the host set ip remote // sets the port number on which the // host is listening save // save the settings in the config file reboot // reboot the rn module so that the // settings take effect 3.5.3.1 tcp connection timers the tcp connection timers control when the rn module opens or closes a socket. 3.5.3.1.1 opening a tcp connection in tcp client mode, the auto-connect timer controls the establishment of a socket con- nection. when set, the device periodically attempts to establish a connection when the timer expires. the set sys autoconn command causes the rn module to connect to the host periodically. the timer determines how often to connect to the stored remote host. if set to 1, the rn module makes one attempt to auto-connect upon power-up. if set to 2 or higher, auto-connect reopens the connection after the connection is closed. the default value of 0 disables the timer. table 3-16: methods of co nnecting to a remote host method type description auto connect internal rtc timer connect to the host at specific time intervals based upon the set sys autoconn command setting. open uart in command mode, issue the open command. connect on uart data uart mode 2 this mode is designed for the html client feature. use the set uart mode 2 command to connect the to host automatically when uart data is received. gpio5 alternative gpio functions set the alternative functions for gpio4, gpio5, and gpio6, as described in section 3.13.2.6 ?alternative gpio4/gpio5/gpio6 functions? . set gpio5 high to trigger a tcp connection, and low to disconnect. note: the remote hosts ip address and port number must be specified in the rn modules configuration file for the auto-connect timer to work. downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 43 3.5.3.1.2 closing the tcp connection the rn module supports a disconnect timer in both tcp client and server mode (default mode). this timer can be used to close a tcp connection automatically after a specified number of seconds of no transmit or receive data. to set the disconnect timer, use the set comm idle command, where is the number of seconds. the default comm idle timer value is 0, which means the rn module never disconnects when idle. for example, to close the tcp connection after 5 seconds of inactivity, use the set comm idle 5 command. 3.5.4 using udp to send data udp is a connectionless protocol where there is no initial handshaking between the hosts to set up the udp connection, and the receiver does not send an acknowledg- ment when it receives udp packets. therefore, udp is an unreliable protocol because there is no guarantee that the data will be delivered correctly. however, because it is connectionless, udp is suited for applications that cannot tolerate too much latency, but can tolerate some errors in the data, such as video transmission. to use udp with the rn module, the udp protocol must be enabled using the set ip proto 1 command. the remote hosts ip address and the local and remote port num- ber to be used for udp communications must also be specified. example 3-8 and example 3-9 show the commands to enable udp data transfer. example 3-8: associate with a network example 3-9: set up the protocol and port number because udp is a connectionless protocol, data begins flowing as soon as the rn module is rebooted. unlike tcp, it is not necessary to send a set comm open command to establish the connection. the rn module acts like a data pipe where the uart data is sent over the wi-fi link via the udp protocol (in this case) and the data coming from the wi-fi link (via udp protocol in this case) is sent to the uart. set wlan ssid // set the network name set wlan phrase // set the passphrase for wpa & wpa2 modes set ip proto 1 // enable udp as the protocol set ip host
// set the ip address of the remote host set ip remote // set the remote port on which the host listens set ip local // set the port number on which the rn module // listens save // save the settings in the config file reboot // reboot the rn module note: attempting to send data by typing characters on the keyboard or if the microcontroller is not sending data fast enough, the rn module sends out packets with fewer data bytes. to avoid this issue, set the flush timer to a higher value. by default, it is set to 10 ms. forwarding can be disabled based on the flush timer ( set comm time 0 ) or set it to a higher value ( set comm time 2000 ). downloaded from: http:///
wifly command reference manual ds50002230b-page 44 ? 2014-2015 microchip technology inc. 3.5.4.1 udp auto-pairing with the udp auto-pairing feature, the rn module temporarily stores the host ip address of the first remote device that sends a udp packet to the rn module. this host ip address is stored in the rn modules ram, which is cleared when the rn mod- ule sleeps or power cycles. this feature allows the rn module to echo to any client that sends a udp packet. example 3-10: turn on auto pairing 3.5.4.2 udp retry this feature adds a level of reliability to the udp protocol without adding the complete overhead of the tcp protocol. when enabled, the rn module waits for a response on every udp packet that is sent (any udp packet coming back in). if the rn module does not receive the response packet by approximately 250 ms, the same udp packet is sent out. this process continues until either a udp response is seen or a new udp packet is sent from the rn module and is acknowledged. refer to ?set ip flags ? for information on the bit to set to enable this feature. 3.5.4.3 udp broadcast the rn module can be set up to generate udp broadcast packets automatically, which is useful for the following reasons: some access points disconnect devices that are idle. udp broadcast informs the access point that the rn module is alive and wants to stay associated. applications can use this feature to automatically discover and configure the rn module. if an application is listening for the udp broadcast, a number of useful parameters are present in the package that can be used for auto-discovery. for example, the rn modules ip address and port number are part of the packet, thus an application can connect to the rn module and remotely configure it. the associated access points mac address, channel, and rssi value are also available in this packet, enabling a simple location and tracking function. by default, the rn module sends out a udp broadcast to 255.255.255.255 on port 55555 at a programmable interval. the broadcast address, port, and interval are set using the set broadcast commands. set ip host 0.0.0.0 // set the ip host to 0.0.0.0 set ip flags 0x40 // set the ip flags to 0x40 note: the rn modules sensor data out can be sent via udp broadcast. the analog-to-digital converter is 14 bits on a 400 mv signal, which translates to about 24 microvolts (0x61a80 in hex). using the show q command in command mode, the rn module displays the raw readings. however, for http web posting and udp broadcast packets, the rn module shifts the reading by four bits (which is a divide by 16) resulting in a 16-bit number. therefore, to obtain the actual voltage sampled, the 16-bit number must be shifted left by four bits to get the number of microvolts. if the value in millivolts is known (and high accuracy is not needed), right shift by another six bits, which is the same as dividing by approximately 1k. downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 45 the packet is 110 bytes of data, as shown in figure 3-12 . figure 3-12: udp broadcast packet byte format 3.5.4.4 udp sleep and connection timers in udp only protocol mode (set with the set ip proto 1 command), the auto-connect timer is used as an auto-sleep timer. when the rn module begins to transmit the first udp data packet, this timer begins counting down. when it reaches zero, the rn module sleeps. the udp auto-sleep timer can be set using two commands: set sys autosleep and set comm timer . the timer interval is a product of the auto-sleep value and the com- munication flush timer (in ms). the timer is decremented every product millisecond. for example, for a udp sleep timer of 40 ms, use the following commands: set sys autosleep 4 // set auto-sleep value to 4 set comm timer 10 // set comm timer to 10 ms (default value) the resulting udp sleep timer is four times 10 ms or 40 ms. to achieve the same effect, set autosleep = 2 and comm timer = 20 . note: to add sensor data to the udp broadcast message, the sensors must be enabled using the sensor mask. the set q sensor 0xff command enables all sensors. 0 - 5 6 7 8 - 9 10 - 13 14 - 15 16 - 17 18 - 31 32 - 59 60 - 91 92 - 93 94 - 110 version string with date code (2  bytes)  programmable ascii time (1  c ytes) gpio pin value (2 c ytes) access points mac address (6 c ytes) channel (1 c yte) rssi (1 c yte) l o cal tcp port (2 c ytes)  rtc v a lue, msb to lsb (4 c ytes) battery voltage pgqjo in mv, e.g., 2755
(2 c ytes)  position sensor 0 - 7 voltage readings enabled with vhwrswirupdw pdvn ! (16 bytes) device id set with vhwrswlrqghylfhlg vwulqj! (32 c ytes) #ppu5jnfjont czuft
note: it is recommended to use a minimum value of 2 (when the default flush time is 10 ms) to ensure that the udp packet is transmitted. for larger packets, the value should be increased. downloaded from: http:///
wifly command reference manual ds50002230b-page 46 ? 2014-2015 microchip technology inc. 3.6 using the html client feature the rn module has a built-in html client. when enabled, the rn module can get or post data to a web server. for example, the html client can be used to post serial and/or sensor data to the host web server. this feature makes it possible to provide wi-fi capabilities to applications such as gps units, remote sensors, and weather stations, among others. 3.6.1 retrieve web server data in this example, data is retrieved from the web server with the format: http://www.webserver.com/ob.php?obvar=weather to perform this function, use the following settings: set ip proto 18 // enable the html client set dns name www.webserver.com // set the web server name set ip address 0 // turn on dns set ip remote 80 // set the web server port, // 80 is standard set com remote 0 // turn off the remote string so // that it does not interfere with // the post to make the connection, use the open command or use open www.webserver.com 80 . the users microprocessor writes the following string to the uart: get /ob.php?obvar=weather \n\n where the \n is the line feed character (decimal 10 or hex 0xa). two line feeds are required for the web server to know that the page is complete. 3.6.2 built-in html client modes the rn module can be set up to post data to and get data from a web server automat- ically without an external host cpu. these advanced web features are enabled using the set opt format command, where represents a bit-mapped reg- ister. refer to ?set opt format ? for the bit function descriptions. ta b l e 3 - 1 7 describes the wake reason values. example 3-11: html client modes note: some web servers require a carriage return and a line feed to indicate the page is complete. in this case, use \r\n at the end of the string instead of \n\n . table 3-17: wake reason values value wake reason 0 undefined 1 power on or hardware reset (battery install or power-up) 2 sleep (wake when the sleep timer is expired) 3s e n s o r 4 undefined 5 undefined 6 software reboot 7 watchdog set option format 1 // automatically send html data header set option format 7 // append sensor data in ascii hex format set option format 11 // append all key value pairs to the sensor data downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 47 3.6.3 connect to a web server automatically the rn module can be configured to post data to a web server automatically using the set sys auto command, where is a decimal number representing seconds. for example, the rn module can be configured to connect to the web server every 10 seconds with the set sys auto 10 command. when http mode is set, the rn module automatically appends two line feeds ( \n\n ) to the end of the packet. as shown in the example, use the following commands to configure the rn module to connect to a web server every 30 seconds. example 3-12: connect to web server every 30 seconds 3.6.4 connect to a web server automatically when uart data is received the rn module supports a mode in which it can connect to the web server when it receives uart data. example 3-13: connect to web server when uart data is received when the serial uart data comes in after issuing the commands shown in example 3-13 , the rn module automatically connects to the web server, and sends: get /userprog.php?data= \n\n note: if the html header contains spaces, the dollar sign ( $ ) character must be used to indicate spaces in the string (a space is the command delimiter). when the rn modules command parser sees the $ , it converts it to a space character. set com remote get$/ob.php?obvar=weather // set up the html string set sys auto 30 // auto-connect every 30 seconds. set option format 1 // send header automatically when the // connection is open set ip proto 18 // turn on http mode = 0x10 + tcp mode = 0x2 note: when attempting to send data by typing characters on the keyboard or if the microcontroller is not sending data fast enough, the rn module sends out small packets of data (it sends out many packets of small mtu size). to avoid this issue, set the flush timer to a higher value, such as set comm time 5000 . by default, it is set to 10 ms. set ip proto 18 // turn on http mode = 0x10 // and tcp mode = 0x2 set dns name www.webserver.com // set the web server name set ip host 0 // turn on dns set ip remote 80 // set the web server port, // 80 is standard set com remote get$/userprog.php?data= // sample server application set uart mode 2 // automatically connect // using data trigger mode downloaded from: http:///
wifly command reference manual ds50002230b-page 48 ? 2014-2015 microchip technology inc. 3.6.5 post binary data web servers expect ascii data. if the user data is binary, the rn module can convert the data to ascii format before sending it to the web server. example 3-14: convert data from binary to ascii if the incoming uart data is six bytes of binary data with hex values 0x01, 0xab, 0x03, 0xff, 0x05, and 0x06, the rn module sends this string to the web server: get /userprog.php?data=01ab03ff0506\n\n 3.6.6 post sensor data automatically the rn module can send the value of the gpio and sensor pins to the web server automatically. the data arrives as 18 bytes of ascii hex data in the format: <2 bytes gpio>. example 3-15: post sensor data to web server the resulting string sent to the server is: get /userprog.php?data=0f3000001111222233334444555566667777\n\n the data format for this example is: set ip proto 18 // turn on http mode = 0x10 // and tcp mode = 0x2 set dns name www.webserver.com // set the web server name set ip host 0 // turn on dns set ip remote 80 // set the web server port, // 80 is standard set com remote get$/userprog.php?data= // sample server application set option format 1 // convert binary data to // ascii hex format note: the analog-to-digital converter is 14 bits on a 400 mv signal 400, which translates to about 24 microvolts (0x61a80 in hex). when the show q command is used in command mode, the rn module displays the raw readings. however, for http web posting and udp broadcast packets, the rn module shifts the reading by four bits (which is a divide by 16) resulting in a 16-bit number. therefore, to obtain the actual voltage sampled, the 16-bit number must be shifted left by four bits to get the number of microvolts. if the value in millivolts is known and high accuracy is not needed, right shift the number by another six bits, which is the same as dividing by approximately 1k. 2 bytes gpio channel 01234567 0f30 0000 1111 2222 3333 4444 5555 6666 7777 set ip proto 18 // turn on http mode = 0x10 // and tcp mode = 0x2 set dns name www.webserver.com // set the web server name set ip host 0 // turn on dns set ip remote 80 // set the web server port, // 80 is standard set com remote get$/userprog.php?data= // sample server application set q sensor 0xff // module samples all eight // sensor channels set sys auto 30 // connect every 30 seconds set option format 7 // send the header plus the // sampled binary data // converted to ascii format downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 49 3.6.7 html client example: posting sensor data automatically in this example, the rn module connects to the web server at the url, www.rovingnetworks.com/server.php?value= , and posts the sensor data to the web server every 60 seconds. set the network connections as previously described, and set the following additional parameters. set ip proto 18 // turn on http mode = 0x10 // and tcp mode = 0x2 set dns name www.rovingnetworks.com // set the web server name set ip host 0 // turn on dns set ip remote 80 // set the web server port, // 80 is standard set com remote get$/server3.php?value= // set up the server // application string set sys auto 10 // automatically connect every 10 seconds set option format 7 // send the header and sampled binary // data converted to ascii set q sensor 0xff // set the sensor mask to sample all channels save // save the configuration to the config file reboot // reboot so that the settings take effect after issuing these commands, the web server returns a 200 ok message, as shown in figure 3-13 . figure 3-13: server response downloaded from: http:///
wifly command reference manual ds50002230b-page 50 ? 2014-2015 microchip technology inc. 3.6.8 html client example: posting uart data to a web server the rn module can post serial uart data in ascii or binary format automatically. in this example, when the serial uart data comes in, the rn module connects and sends data to the web server in the following format: get /server.php?value= \n\n use the following commands to set the parameters: set ip proto 18 // turn on http mode = 0x10 // and tcp mode = 0x2 set dns name www.rovingnetworks.com // set the web server name set ip host 0 // turn on dns set ip remote 80 // set the web server port, // 80 is standard set com remote get$/server3.php?value= // set up the server // application string set sys auto 10 // automatically connect every // 10 seconds set option format 1 // send a html header set uart mode 2 // connect automatically using data trigger mode save // save the configuration to the config file reboot // reboot so that the settings take effect with these settings enabled, the rn module connects to the web server every time it receives data on the rx line. serial data is sent to the host web server according to the flush timer and the flush size. note: the sampled sensor data cannot be appended to the uart data. enabling option format 7 with set uart mode 2 results in erroneous data. downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 51 3.7 ftp client features in addition to downloading firmware via ftp, the rn module can get and put files to an ftp server. 3.7.1 connect to an ftp server by default, the rn module is configured to download the latest firmware from the microchip ftp server. to configure the rn module to connect to another ftp server, the parameters must be adjusted, as described in example 3-16 . example 3-16: connect to an ftp server 3.7.2 creating files on the ftp server once the rn module is configured to connect to the ftp server, it can create files on the ftp server. to create a file, use the ftp put command, where is up to 64 bytes in length. this command creates a file on the ftp server with the name specified in and prints the open string on the uart. by default, the open string is *open* . after *open* appears on the uart, data can be written to the file. there are two options to close the file: send the close string, which is *clos* by default, or use the ftp close timer with the command set ftp timer . once writ- ing to the file is complete, this timer begins counting down and closes the file when the timer reaches zero. the timer is one-eighth of . for example, to set a five second timer, the command would be: set ftp timer 40 . the open and close stings are configurable using the following commands: set comm open // set the open string set comm close // set the close string example 3-17: put file on ftp server set ftp address
// set the ip address of the ftp server. // the default is 208.109.78.34. set ftp dir // set the directory of the ftp server. // the default is public. set ftp user // set the user name set ftp pass // set the password save // save the settings reboot // reboot the rn module note: this example assumes that the ftp server is already set up and configured correctly and that the rn module is already configured to associate with a wireless network. ftp put demo.txt // upload the file demo.txt set ftp timer 40 // close the connection 5 seconds after the // file uploads downloaded from: http:///
wifly command reference manual ds50002230b-page 52 ? 2014-2015 microchip technology inc. 3.7.3 retrieving files from the ftp server the rn module can retrieve files from the ftp server. the retrieved file is not stored in the rn modules flash memory. instead, the rn module acts as a transporter and passes the file over the uart interface as the file is being transferred. to retrieve a file from the ftp server, issue the ftp get command. the rn module prints the open string on the uart and the file begins transferring from the ftp server to the rn module. when the file transfer is complete, the rn module prints the close string indicating the file was transferred and the ftp connection was closed. example 3-18: retrieve file from ftp server ftp get demo.txt // download the file demo.txt from the ftp server downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 53 3.8 putting the rn module to sleep and waking it ta b l e 3 - 1 8 describes the methods for putting the rn module to sleep. ta b l e 3 - 1 9 describes the methods for waking the rn module. 3.8.1 determining when the rn module is ready to accept data when the rn module wakes up from sleep, it takes time (in milliseconds) to initialize the internal hardware. during this time, any data that is sent to the rn module over the uart is not processed. signals that indicate the rn module is ready to accept data can be monitored, as described in table 3-20 . table 3-18: methods for putti ng the rn module to sleep method interface description sleep command uart enter into command mode using $$$ and issue the sleep command. sleep timer internal rtc the rn module sleeps based on the set sys sleep command setting. drive gpio8 high gpio8 the rn module sleeps as soon as gpio8 is held high (4 s latency). to enable this feature, use the set sys trigger 0x20 command setting. table 3-19: methods for waking the rn module method interface description sensor input (1.2v dc only) sensor pins wake the rn module using sensor pins 0-3 (1.2v dc only). use the set sys trigger command to enable the sensors. rx pin (3.3v dc only) rx pin via sensor 0 the rx pin on the rn134 and the rn174 evaluation boards is tied to sensor pin 0 via a resistor divider network. use the set sys trigger 1 command to wake the rn module when it receives rx data. note: with this method, the rn module may drop the first uart data byte. a better method is to wake the rn module using the cts pin. cts pin (3.3v dc only) cts pin via sensor 1 the cts pin on the rn134 and the rn174 evaluation boards is tied to sensor pin 1 via a resistor divider network. use the set sys trigger 2 command to wake the rn module using the cts pin. wake timer internal rtc the wake timer wakes the rn module based on the set sys wake command setting. force awake force awake pin an input pulse of at least 31 s (3.3v) wakes the rn module. table 3-20: signals indicating the rn module can accept data method interface description rts transition rts pin when the rn module wakes up, the rts pin goes high. o nce the rn module is ready, the rts pin is driven low. this pin can be monitored with a microcontroller. monitor gpio4 alternative gpio functions set the alternative functions for gpio4, gpio5, and gpio6 (see section 3.13.2.6 ?alternative gpio4/gpio5/gpio6 functions? ). when the rn module wakes up and connects to an access point, gpio4 goes high, indi- cating the rn module is ready to receive data over the uart. a microcontroller can monitor gpio4. sensor power sensor power pin the rn module can be configured to output v bat , or 3.3v or 1.2v on the sensor power pin when it wakes from sleep, indicating it is ready to accept data. downloaded from: http:///
wifly command reference manual ds50002230b-page 54 ? 2014-2015 microchip technology inc. 3.8.2 wake on sensor input four sensor input pins (sense0 through sense3) wake the rn module from sleep. these pins have a small current source that is activated in sleep mode. this source is approximately 100 na, and causes the input to float up to approximately 1.2v dc. if, for example, sense1 is enabled, pulling the sense1 pin to ground wakes the rn module. to enable the sensors to wake the rn module, use the command set sys trigger , where is a bit-mapped setting of each sensor. for example, to wake the rn module using sensor pin 2, use the command set sys trig 4 . setting the trigger value to 0 disables all sensor pins. ta b l e 3 - 2 1 describes the values to wake the rn module using individual sensor inputs. the sensor inputs are rated 1.2v dc, maximum. a resistor divider must be used when driving a sensor pin from the other 3v pins such as rx. use a resistor divider network with a minimum of 24k in series and 10k to ground from the uart rx or cts pin. an open-drain fet is an appropriate device to tie to the sensor pin as the threshold is approximately 500 mv. additional pull-ups up to 1.2v dc can be used if the circuit has an impedance (due to leakage current) of less than 5 m ? (500 mv/100 na). leave unused sensor pins disconnected. 3.8.3 wake on uart activity when the rn module is in sleep mode, the uart is disabled. however, the rn module can wake on uart activity by connecting the sensor pins to the rx data or cts pin (using the appropriate divider resistors as described in section 3.8.2 ?wake on sensor input? ). the rn134 and the rn174 evaluation boards have a built-in resistor divider connect- ing sense0 and sense1 to rxd and cts, respectively. this setup allows wake on rx and cts using a 3.3v signal. to enable wake on rxd, use the command set sys trig 1 . the first byte (or possibly multiple bytes) sent to the rn module will likely be lost; there- fore, care must be taken to send a preamble byte to wake the rn module be fore sending valid data bytes. alternatively, use the cts input to wake the rn module and wait until it is ready to accept data. to enable this setting, use the command set sys trig 2 . table 3-21: sensor input values wake on sensor input value command 01 set sys trigger 1 12 set sys trigger 2 24 set sys trigger 4 38 set sys trigger 8 warning the voltage on any sensor input cannot exceed 1.2v dc or the rn module will be permanently damaged. warning do not apply 3.3v directly to sense0 and sense1; the voltage on any sensor input cannot exceed 1.2v dc or the rn module will be permanently damaged. downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 55 3.8.3.1 uart receiver and rts/cts hardware flow control the uart receive buffer is approximately 1,500 bytes. at lower baud rates (less than 115k), the system can send data over tcp/ip without flow control. depending on the frequency and quantity of the data being sent, the comm parameters optimize wi-fi performance by specifying when the system sends ip packets. to min- imize latency and tcp/ip overhead, use the flush size or match character to send data in a single ip packet. in most cases, set the flush timer to a large number to avoid fragmentation. for high throughput, increase the uart baud rate, set the flush size to 1,460, and set the flush timer to a large value so that full ip packets are sent. control packet forwarding can be controlled in the following ways: set comm match sets the value of the packet terminator. each time the rn module sees the match character it sends an ip packet. for example, set comm match 0xd forwards a packet when the rn module sees a 0xd hex character. set comm size sets the flush size, where is the number of bytes received before forwarding. the maximum is 1,460 bytes, which is the size of a single ethernet frame. set comm time sets the flush timer, which is used to flush any partial data sitting in the rx buffer if no additional data is received for ms. for example, the set comm time 1000 command causes the rn module to wait for 1 second after no data was sent. if the rn module will be sending more than a few hundred thousand bytes in a single transaction, hardware flow control should be enabled. the hardware must actively monitor the cts pin. flow control is not enabled by default and is set with the set uart flow 1 command. it is possible to operate higher baud rates (i.e., greater than 115k) without flow control if the packets are uniform and an application protocol is used to ensure that the packet data is delivered on the remote side before the next packet is sent. however, given the uncertainty of packet delays in a tcp/ip network and the effects of interference and retries inherent in wireless networks, flow control is typically required whenever larg e, contiguous quantities of data are being written to the uart to ensure no data is lost. downloaded from: http:///
wifly command reference manual ds50002230b-page 56 ? 2014-2015 microchip technology inc. 3.9 gpio functions this section provides information on gpio functions. 3.9.1 setting gpio direction, alternate functions, and disabling leds the gpio pin direction and function are controlled using these two commands: set sys mask set sys iofunc 3.9.1.1 control gpio direction with set sys mask the gpio pin direction can be controlled with the gpio mask using the set sys mask command, where is entered as a hex number. the hex number rep- resents a bitmask that controls each pin, where 1 = output and 0 = input. for example: set sys mask 0x0 // sets all pins as inputs set sys mask 0xc0 // set only gpio6 and gpio7 to set only one bit in the mask, it is necessary to read, mask, and set the value. otherwise, any previous gpio settings will be overwritten. the default mask for the rn131 module is 0x20f0, which sets gpio13, gpio7, gpio6, gpio5, and gpio4 as outputs. the default mask for the rn171/rn1723 module is 0x21f0, which corresponds to the following settings: gpio0-gpio3 are used internally on the rn module gpio4-gpio6 are leds gpio9 is reserved as the factory reset/soft ap mode (read at power-up) and otherwise general purpose input detect pin gpio10-gpio11 are the uart rx and tx pins; tx does not need to be masked as an output gpio12 is cts (input), if used gpio13 is rts (output), if used the rn134 evaluation boards leds are connected to gpio4-gpio6. to disable the leds, enable the alternative functions of the leds (use the set sys iofunc 0x7 command). the blue led on the rn174 evaluation board is connected to gpio7, which is output by default. the board does not drive this led because the default power-up state of gpio7 is low. the get sys command shows the setting of the gpio mask, as shown in example 3-19 . example 3-19: gpio mask setting note: to set the gpio pins as inputs or outputs instantly, use the set sys mask 0xabcd 1 command, which does not require a reboot. note: it is possible to turn off the yellow, red, or green leds. however, the blue led on the rn134 evaluation board serves as the power indicator and cannot be turned off. <2.21> get sys sleeptmr= iofunc=0x0 iomask=0x21f0 downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 57 figure 3-14 shows the bits corresponding to the gpio pins and table 3-22 shows the gpio pin usage, their default state, and functionality. figure 3-14: gpio pin bitmask 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 gpio0 gpio1 gpio2 gpio3 gpio4 gpio5 gpio6 gpio7 gpio14 gpio13 uart rts gpio12 uart cts gpio11 uart rx gpio10 uart tx gpio9 gpio8 table 3-22: gpio pin usage, de fault state, and functionality bit signal name rn131 default state rn171/rn1723 default state default function 0 gpio0 n/a n/a not used by rn modules, but can be used as a sensor input. 1 gpio1 n/a input not used by rn modules, but can be used as a sensor input. 2 gpio2 n/a input not used by rn modules, but can be used as a sensor input. 3 gpio3 n/a input not used by rn modules, but can be used as a sensor input. 4 gpio4 output output green led 5 gpio5 output output yellow led 6 gpio6 output output red led 7 gpio7 output output blue led (1) 8 gpio8 input output this pin can be used to place the rn module into sleep mode. 9 gpio9 input input soft ap/multi-purpose gpio (2) 10 gpio10 output output uart tx 11 gpio11 input input uart rx 12 gpio12 input input throttles the transmitter if hardware flow control is enabled. driving this pin low enables transmitter; driving this pin high disables it. 13 gpio13 output output this pin goes high on power-up and goes low when the system is ready. if hardware flow control is enabled, this pin toggles to high to indicate the rx buffer is full. 14 gpio14 n/a input not used by rn modules, but can be used as a sensor input. note 1: on the rn174 evaluation board, the blue led is connected to gpio7. the blue led is not connected to gpio7 on the rn134 evaluation board. it is not possible to power off the blue led on the rn134 evaluation board because it is connected directly to power. 2: the gpio9 pin can be used for factory reset, soft ap mode, or web config mode. downloaded from: http:///
wifly command reference manual ds50002230b-page 58 ? 2014-2015 microchip technology inc. 3.9.1.2 setting the alternate gpio functions the default functionality of gpio4, gpio5, and gpio6 is to control the leds. the default can be overridden to allow user programmable i/o or alternate i/o functionality by using the set sys iofunc command, where is entered as a hex number. the hex value represents a bitmask that controls each bit in the and represents a particular gpio pin. if a bit is 0 , the corresponding gpio pin is driven/read by the firmware per the default function. the i/o function is encoded, as shown in ta b l e 3 - 2 3 . if the leds are disabled using bits 0, 1, and 2, the show i command can be used to read these gpio pins. for example, the show i command might return port=30 . to use the alternate leds functions, use the following commands: set sys iofunc 0x70 // enable alternate function for gpio4-gpio6 save // store configuration reboot // reboot the rn module example 3-20 shows how to control the leds on the evaluation boards. example 3-20: toggle red and green leds table 3-23: gpio pin alternate function bitmask bit (1) signal name direction function 0 gpio4 output disable the led function so the i/o can be used as a gpio pin. 1 gpio5 output disable the led function so the i/o can be used as a gpio pin. 2 gpio6 output disable the led function so the i/o can be used as a gpio pin. 3u n u s e d 4 gpio4 output this pin goes high after the rn module has associated/authenticated and has an ip address. 5 gpio5 input set this pin high to trigger a tcp connection and low to disconnect. 6 gpio6 output this pin goes high when the rn module is connected over tcp and low when disconnected. note 1: bits 0-3 are mutually exclusive with bits 4-6 (i.e., 0x77 is an illegal value). green led: set sys iofunc 0x01 // mask gpio4 from wifly functionality set sys output 0x10 // toggle the state of gpio4 red led: set sys iofunc 0x04 // mask gpio6 from wifly functionality set sys output 0x40 // toggle the state of gpio6 green and red leds: set sys iofunc 0x05 // mask gpio4 and gpio6 from wifly // functionality set sys output 0x50 // toggle the state of gpio 4 and gpio6 downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 59 3.10 setting debug print levels the print functions can be enabled to assist with debugging the operation and status of the rn module. the set sys printlvl command controls these additional print functions, where is a bit-mapped register that controls which printout messages are sent to the uart. see ?set sys printlvl ? for more information. 3.10.1 scan output format the scan output format shown in the following example can be enabled using the set sys printlvl 0x4000 command. where: ta b l e 3 - 2 4 shows the security modes. ta b l e 3 - 2 5 describes the capabilities bit mask values. index channel rssi security mode capabilities wpa configuration wps mode mac address ssid field value index 2 character, decimal channel 2 character, decimal rssi 2 character, decimal (negative number) security mode 2 bytes (see ta b l e 3 - 2 4 ) capabilities bit-mapped 4 hex bytes (see table 3-25 ) wpa configuration bit-mapped 2 hex bytes (see table 3-26 ) wps mode bit-mapped 2 hex bytes (see table 3-24 ) mac address address ssid up to 32 characters note: the string end is added at the end of the scan data. table 3-24: security modes number description 0 open 1 wep (64 or 128) 2w p a 1 3 mixed 4w p a 2 5 enterprise wep 6 enterprise wpa1 7 enterprise wpa mixed 8 enterprise wpa2 9 enterprise no security table 3-25: capabilities bit mask values bit mask value description 0004 short slot time 0100 ess (infrastructure mode) 1000 privacy (secure with wep or wpa) 2000 short preamble downloaded from: http:///
wifly command reference manual ds50002230b-page 60 ? 2014-2015 microchip technology inc. ta b l e 3 - 2 6 describes the wpa bit mask values. ta b l e 3 - 2 7 describes the wps bit mask values. 3.10.2 uart heartbeat messages the rn module can output uart heartbeat messages. the bit-mapped message is output periodically while the rn module is in data mode and not connected to a remote host. messages are not output while in command mode. the heartbeat message encodes the rn modules state for the embedded microprocessor. based on the heart- beat message, the microprocessor can choose to change the configuration by going into command mode. to enable the uart heartbeat messages, use the set sys printlvl 0x10 command. the output of this mode is: *8b30*8b30*8b30. ta b l e 3 - 2 8 shows the output bit format. table 3-26: wpa bit mask values bit mask value description 04 wpa_unicast_tkip 08 wpa_unicast_aes_ccmp 10 wpa_broadcast_tkip 20 wpa_broadcast_aes_ccmp table 3-27: wps bit mask values bit mask value description 02 wps_pushbutton_active 40 wps_supported 80 wps_pushbutton_supported note: for soft ap mode, the uart heartbeat message reflects the number of client devices associated with the rn module. in this case, the number 8 in the output is incremented according to the number of devices currently associated to the soft ap network. for example: *81xx indicates no associated client devices, *91xx indicates one associated client device, and *a1xx indicates two associated client devices, etc. table 3-28: output bit format bit 15...14 13...12 11...8 7...6 5 4 3...0 function fixed reserved channel reserved authentication association tcp status value 2 = soft ap mode unused 0-13 unused 1 = ok 1 = ok 0 = idle 1 = connected 3 = no ip 4 = connecting 5 = challenge for password downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 61 3.11 using the real-time clock function the rn modules real-time clock keeps track of the number of seconds since the rn module was powered on and the actual time when the rn module synchronized with the sntp time server. by default, the rn module keeps track of up-time but does not synchronize with the time server because this synchronization requires the rn module to be associated with a network that can access the sntp server. the real-time c lock reads the time in seconds since 1970, which corresponds to the unix time. the rtc value in seconds can be set using the set time rtc command. the default sntp server is: addr=129.6.15.28:123 zone=7 (gmt -7) use the show time command to see the current time and up-time, as follows: <2.23> show t time=08:43:10 uptime=10 s to set the time, use the time command: <2. 23> show t time not set uptime=8 s <2. 23> time <2. 23> show t time=08:51:31 uptime=15 s the rn module can also be configured to get the time whenever it powers up using the set time enable 1 command. if time enable is set to a value greater than 1, the rn module pulls the time continuously every minutes. to configure the rn module to get time upon power-up, see the following example: <2. 23> set time enable 1 aok <2. 23> get time ena=1 addr=129.6.15.28:123 zone=7 to view a complete listing of the time variable, use the following command: <2. 23> show t t time=09:02:10 uptime=653 s rtc=1293567548 restarts=1 wake=6 raw=2345ab note: the rn module must be associated with a network for the rn module to contact the sntp server. note: the raw value is the 64-bit hex raw value of the rtc, which counts at 32,768 hz. downloaded from: http:///
wifly command reference manual ds50002230b-page 62 ? 2014-2015 microchip technology inc. 3.12 time stamping packets the time stamping feature can be used to append 8 bytes to a tcp or udp packet automatically. the set ip flags 0x87 command enables the time stamp and keeps other default settings). the time stamp bits from msb to lsb are as follows: the eight bytes represents the 64-bit raw value of the real-time clock register. the data is appended before calculating the tcp checksum so that the data passes through the tcp stack correctly. this register counts at 32,768 hz. if the timeserver function is enabled, the rtc should accurately reflect the real time. this register also counts when the rn module is in sleep mode. users tcp or udp packet data 63...56 55...48 47...40 39...32 31...24 23...16 15...8 7...0 downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 63 3.13 soft access point (soft ap) mode rn modules support several methods for accessing wi-fi networks. in addition to infrastructure mode, rn modules support soft access point (soft ap) mode. in soft ap mode: the rn module creates a soft ap network to which android devices (smartphones and tablets) can join the rn module runs a dhcp server and issues ip addresses to seven clients the rn module supports security the rn module supports routing between clients the following sections describe how to use soft ap mode with an rn module, including configuring the rn module to act as an access point, enabling soft ap mode in hardware and software, and sending data to the rn module from a remote host. 3.13.1 enabling soft ap mode there are two methods for enabling soft ap mode: hardware and software. these methods are described in the following sections. 3.13.1.1 enable soft ap mode in hardware to enable soft ap mode in hardware, hold the gpio9 pin high at 3.3v, and then reset (i.e., power cycle) the rn module. the rn module will then boot-up in soft ap mode with the dhcp server enabled. ta b l e 3 - 2 9 shows the default soft ap mode settings. when the rn module boots up in soft ap mode, other wi-fi enabled devices, such as pcs, iphones, ipads, and android tablets, should be able to see the rn module when they scan for access points. note: depending on the firmware version, soft ap mode is available for use by rn modules, as follows: rn131 and rn171 modules with firmware version 2.45 and later rn1723 modules with firmware version 1.0 or later table 3-29: default soft ap mode settings setting soft ap mode default ssid wifly-xxx-yy, where xxx is: gsx (rn131 module) ezx (rn171 module) fzx (rn1723 module) and yy is the lsb byte of the rn modules mac address channel 1 dhcp server enabled ip address 192.168.1.1 netmask 255.255.255.0 gateway 192.168.1.1 note: microchip recommends setting the rn module as the gateway when creating a point-to-point network between devices (wi-fi network only). downloaded from: http:///
wifly command reference manual ds50002230b-page 64 ? 2014-2015 microchip technology inc. 3.13.1.2 enable soft ap mode in software soft ap mode can be enabled in software using the set wlan join 7 command. net- work settings such as the ssid, channel, and ip address can be customized in software to create a custom soft ap mode. for example, the following commands create a custom soft ap mode in software: set wlan join 7 // enable soft ap mode set wlan channel // specify the channel to create network set apmode ssid // set up network broadcast ssid (bssid) set apmode passphrase // set the soft ap mode passphrase set ip dhcp 4 // enable dhcp server set ip address
// specify the ip address set ip net
// specify the subnet mask set ip gateway
// specify the gateway save // store settings reboot // reboot the rn module in soft ap mode after rebooting, the rn module is in soft ap mode with the custom settings (ssid, channel, ip address, netmask, and gateway). a quick method of creating a soft ap network is to use the apmode command, where is the broadcast ssid and is the channel on which the soft ap network is created. the and parameters are optional. if no parameters are specified, the rn module: uses the string stored with the set opt device_id command and appends -xy , where xy is the last byte of the rn modules mac address as the ssid creates the soft ap network on channel 1 example apmode mynetwork 11 // creates a soft ap network on channel 11 // with the ssid mynetwork 3.13.2 using soft ap mode this section describes how to use soft ap mode, including connecting to the rn module, checking for the last device connected over tcp, viewing associated devices, enabling the link monitor, and routing data between clients. 3.13.2.1 connect to the rn module once the rn module boots up in soft ap mode, any client device can associate with the network the rn module is broadcasting. once associated, the rn modules dhcp server assigns an ip address to the client device. the default lease time is 1 day (i.e., 86,400 seconds). the lease time can be configured using the set dhcp lease command, where is the time in seconds. to view a list of devices associated with the rn module, use the show lease command. the command output is in the following format with commas delimiting the fields: note: this command does not survive power cycling. after a power cycle, the rn module behaves according to the wireless join policy determined by the set wlan join command. ip address assigned client mac address remaining lease time (in seconds) host name downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 65 example 3-21 shows output from the show lease command. example 3-21: show lease command output once a client is associated to the network, it can open a tcp connection to the rn module. after successfully opening a tcp connection, the client receives a *hello* message. the rn module prints *open* on the uart, indicating an open tcp connection. 3.13.2.2 check for the last connected device over tcp in some cases, it is beneficial to know the ip address of the last device that connected to the rn module over tcp or the last device to which the rn module connected over tcp. to find this address, use the show z command. please note that this command does not survive a power cycle or reboot. upon power-up, if no device is connected over tcp, the show z command returns 0.0.0.0 . 3.13.2.3 view associated devices to see a list of devices associated with the rn module, use the show associated com- mand. the command output is in the following format with commas delimiting the fields: example 3-22 shows output from the show associated command. example 3-22: show associate command output the seconds since last packet received output can be used to check for stale connections. <2.42> show lease 1.2.3.10,f0:cb:a1:2b:63:59,153,* 1.2.3.11,00:00:00:00:00:00,0, 1.2.3.12,00:00:00:00:00:00,0, 1.2.3.13,00:00:00:00:00:00,0, 1.2.3.14,00:00:00:00:00:00,0, 1.2.3.15,00:00:00:00:00:00,0, 1.2.3.16,00:00:00:00:00:00,0, <2.42> note: in soft ap mode, the rn module can assign a dhcp lease to seven clients. however, not all clients report the host name. in this case, the rn module reports the host name as an asterisk ( * ). connection number host mac address received byte count transmitted byte count seconds since last packet received <2.42> show associated 1,f0:cb:a1:2b:63:59,36868,0,7 2,00:24:8c:31:e5:27,76168,0,2 3,98:4b:4a:6b:e0:0f,1992,0,0 <2.42> downloaded from: http:///
wifly command reference manual ds50002230b-page 66 ? 2014-2015 microchip technology inc. 3.13.2.4 enable the link monitor soft ap mode supports a link monitor feature to detect whether or not individual client devices are active and in range of the rn module. the link monitor is a timer (in seconds) that checks to see if any packets are received from an associated device. if the timer expires, the access point module deauthenticates the client(s). this feature is useful for aging out clients that do not send any traffic over wi-fi. the link monitor is enabled using the set wlan fmon command, where is a decimal number representing the number of seconds of client inactivity (i.e., no data received from the client device). this command sets the soft ap mode link monitor time-out threshold for each associated client device. when this timer expires, the rn module deauthenticates that particular client. setting this timer to a lower value, such as 10 seconds, may result in frequent deauthentications for client devices if they do not send data before the timer expires. to disable the link monitor timer, set to zero (0). the default is 3600. example set wlan fmon 1000 // set the fmon timer to 1,000 seconds 3.13.2.5 route data between clients soft ap mode supports routing between clients. clients can ping each other via soft ap mode and can also send data to each other over tcp and udp. 3.13.2.6 alternative gpio4/gpio5/gpio6 functions gpio4, gpio5, and gpio6 have alternative functions in soft ap mode, as described in 3.13.2 ?using soft ap mode? . the alternative functions are enabled using the following command: set sys iofunc 0x70 // enables alternative functions the link monitor feature must be enabled to turn on the alternative functions in soft ap mode only. table 3-30 shows the gpio alternative functions. note: routing data between clients is not supported when wpa2-psk encryption is enabled. table 3-30: alternative gpio functions gpio description gpio4 high when the first client associates; low when all clients leave the network. gpio5 the rn module can drive gpio5 high to open a tcp connection to a stored host. when the rn module drives gpio5 low, it closes the tcp connection. gpio6 the rn module drives gpio6 high when a tcp connection is open and low when a tcp connection is closed. downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 67 3.14 upgrading firmware 3.14.1 upgrading firmware via ftp the rn module has a file system for storing firmware and configuration files. use the ls command to view files. the file size is displayed in sectors and the active boot image is identified in the final message. for example: fl# siz flags 11 18 3 wifly_gsx-2.21 29 1 10 config 190 free, boot=11, backup=0 it is possible to store multiple firmware images and configuration files in the file system of the rn module. the rn module contains a built-in ftp client for downloading files and updating the firmware. the client uses passive mode ftp, which allows operation through firewalls and the internet. to connect to microchip to obtain the latest released firmware, use the settings shown in ta b l e 3 - 3 1 . 3.14.1.1 upgrading with multiple image format (mif) files the mif ( .mif ) files contain the firmware image ( .img ) and associated applications and files to support all of the features of the installed firmware. rn modules that support the mif file format can unpack the . mif file and install the applications and files into the rn modules flash memory. download the .mif file using one of the following commands: ftp update wifly3-400.mif (rn131 module) ftp update wifly7-400.mif (rn171 module) ftp update wifly7-100.mif (rn1723 module) note: the rn modules flash file system only is used to store firmware and configuration files. the file system cannot be used to store data files. table 3-31: ftp settings setting description ftp server rn.microchip.com (set ftp server using the set dns backup command) ftp username roving ftp password pass123 ftp filename refer to the following sections for the filename used in different versions of firmware. ftp directory ./public (this parameter cannot be modified) note: before using ftp to upgrade the firmware, the rn module must first be associated with an access point that is connected to the internet. note: upgrading using the mif file description, is only available for the following rn modules: rn131 and rn171 modules with firmware version 4.0 and later rn1723 modules with firmware 1.0 or later downloaded from: http:///
wifly command reference manual ds50002230b-page 68 ? 2014-2015 microchip technology inc. after downloading the .mif file, the rn module unpacks it and automatically reboots into the new boot image with all of the associated files installed into the rn modules flash memory. ta b l e 3 - 3 2 describes these files. the firmware image, applications, and associated files in the flash memory can be verified using the ls command, as shown in example 3-23 . example 3-23: ls command example output table 3-32: firmware and associated applications file name description comments wifly_ezx-2.45 wifly-ezx-307 wifly-ezx-400 wifly-fzx-100 firmware image files ( .img ) filenames beginning in wifly are typically firmware images. wps_app-ezx-131 eap_app-ezx-101 web_app-ezx-105 web_app-fzx-112 application files these application files are used for specific module features. web_config.html link.html html files these files are used for the configuration web server feature. logo.png logo file logo displayed on web pages. used for the configuration web server feature. config configuration file the config file stores the rn modules boot-up parameters. <3.07> ls fl# siz flags 2 83576 3 wifly_ezx-2.45 23 -1 10 config 25 85512 3 wifly-ezx-307 26 46624 3 wps_app-ezx-131 27 66248 3 eap_app-ezx-101 28 74280 3 web_app-ezx-105 29 37014 0 web_config.html 30 512 0 link.html 31 1609 0 logo.png 149 free, boot=25, backup=2 <3.07> downloaded from: http:///
features and settings ? 2014-2015 microchip technology inc. ds50002230b-page 69 3.14.1.2 upgrading firmware to version 4.0 to update the firmware from a version prior to 4.0, follow this process: 1. update the firmware .img file to version 4. xx using one of the following commands: ftp update wifly3-400.img (rn131 module) ftp update wifly7-400.img (rn171 module) 2. remove the old configuration using the following command: del config 3. reboot the rn module to boot into the new image. 4. download the .mif file using one of the following commands: ftp update wifly3-400.mif (rn131 module) ftp update wifly7-400.mif (rn171 module) after the rn module downloads the .mif file, the rn module automatically reboots into the boot image with all of the associated files installed into the rn modules flash memory. refer back to ta b l e 3 - 3 2 for a description of these files. the firmware image, applications, and associated files in flash memory can be verified using the ls com- mand (see example 3-23 ). 3.14.1.3 upgrading firmware prior to version 4.0 to update the firmware to a version prior to 4.0 (e.g., from version 2.45 to 3.07), issue the command ftp update , where is an optional file name (use the optional name to bypass the default firmware file name). the rn module retrieves the file and switches the boot image to the new file, resulting in the following messages: <2.20> ftp update <2.20> ftp connecting to 208.109.78.34 ftp file=30 ...................................................................... ftp ok. note: upgrading firmware to version 4.0 is only applicable to the rn131 and rn171 modules. notice it is mandatory that the rn module be reset to the factory default settings at this point using the factory reset and reboot commands. note: upgrading firmware to a version prior to 4.0 is only applicable to the rn131 and rn171 modules. caution after the rn module reboots with the new firmware, it is recommended to reset the rn module to the factory default parameters using the factory reset command. failure to do so may result in some variables being initialized with random values. downloaded from: http:///
wifly command reference manual ds50002230b-page 70 ? 2014-2015 microchip technology inc. the previous firmware becomes the back-up image. the following example shows the file system after a successful update: fl# siz flags 11 18 3 wifly_gsx-2.20 29 1 10 config 30 18 3 wifly_gsx-2.21 208 free, boot=30, backup=11 after downloading, the firmware checks the image and compares it to the stored values in the file before committing the image to flash and updating the boot record. if the checksum fails, the rn module displays update failed=x and deletes the image. for example, issue the following command to boot the previous image using the previous example: <2.20> boot image 11 set boot image 11, =ok 3.14.1.4 optional ftp up date command parameters the optional ftp update command parameter options are: ftp


▲Up To Search▲   

 
Price & Availability of RN171XVU-IRM

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X